<?php

require_once 'testgame.php';
require_once '../game/Engine.php';
require_once '../game/Player.php';

class EngineTest 
{
	public function RunEngineTest()
	{		
		$f_engine = new \game\Engine();
		
		$f_testgame = new Testgame();
		$f_engine->SetCurrentGame($f_testgame->testgame);
		
		//run all tests
		$this->TestMoveRobot($f_engine);

		$f_testgame = new Testgame();
		$f_engine->SetCurrentGame($f_testgame->testgame);
		$this->TestCanConveyorMoveRobot($f_engine);

		$f_testgame = new Testgame();
		$f_engine->SetCurrentGame($f_testgame->testgame);
		$this->TestCanMoveRobot($f_engine);

		$f_testgame = new Testgame();
		$f_engine->SetCurrentGame($f_testgame->testgame);
		$this->TestMoveConveyorBelts($f_engine);

		$f_testgame = new Testgame();
		$f_engine->SetCurrentGame($f_testgame->testgame);
		$this->TestRotateGears($f_engine);

		$f_testgame = new Testgame();
		$f_engine->SetCurrentGame($f_testgame->testgame);
		$this->TestFireRobotLasers($f_engine);

		$f_testgame = new Testgame();
		$f_engine->SetCurrentGame($f_testgame->testgame);
		$this->TestFireBoardLasers($f_engine);

		$f_testgame = new Testgame();
		$f_engine->SetCurrentGame($f_testgame->testgame);
		$this->TestCheckFlags($f_engine);

		$f_testgame = new Testgame();
		$f_engine->SetCurrentGame($f_testgame->testgame);
		$this->TestPushPushers($f_engine);
	}
	
	public function TestMoveRobot($a_engine)
	{
		$f_ok = true;

	    $f_game = $a_engine->m_currentGame;
	    $f_caseID = 0;
	
	    $f_playerA = $this->CreatePlayer("A");
		$f_playerA->m_robot = $this->CreateRobot(1, 1, \game\Direction::Right);			    
	    $f_game->AddPlayer($f_playerA);
	
	    $f_playerB = $this->CreatePlayer("B");
	    $f_playerB->m_robot = $this->CreateRobot(3, 1, \game\Direction::Right);    
	    $f_game->AddPlayer($f_playerB);
	
	    //old pos is 1,1
	    $a_engine->MoveRobot($f_playerA->m_robot, 5,5);
	
	    if ($f_game->m_map->m_tiles[1][1]->r_robot !== null || $f_playerA->m_robot->m_posX !== 5 || $f_playerA->m_robot->m_posY !== 5 || $f_game->m_map->m_tiles[5][5]->r_robot !== $f_playerA->m_robot)
	    {
	        echo "case " . $f_caseID . ": Moving robot from point1 to point2 - FAILED<br/ > ";
	        $f_ok = false;
	    }
	    $f_caseID++;
	
	    //Old pos is 3,1
	    $a_engine->MoveRobot($f_playerB->m_robot, 5,5);
	    //old pos is 5,5
	    $a_engine->MoveRobot($f_playerA->m_robot, 3,1);
	
	    if ($f_game->m_map->m_tiles[5][5]->r_robot !== $f_playerB->m_robot || $f_playerB->m_robot->m_posX !== 5 || $f_playerB->m_robot->m_posY !== 5 || $f_game->m_map->m_tiles[3][1]->r_robot !== $f_playerA->m_robot || $f_playerA->m_robot->m_posX !== 3 || $f_playerA->m_robot->m_posY !== 1)
	    {
	        echo "case " . $f_caseID . ": Moving B to A, A to old B, checking references if they are set correctly - FAILED<br/ > ";
	        $f_ok = false;
	    }
	    $f_caseID++;
	
	    $f_game->m_map->m_tiles[1][1]->m_type = \game\TileType::Hole;
	    //old pos is 3,1
	    $a_engine->MoveRobot($f_playerA->m_robot, 1,1);
	
	    if ($f_game->m_map->m_tiles[3][1]->r_robot !== null || $f_game->m_map->m_tiles[1][1]->r_robot !== null || $f_playerA->m_robot->m_alive)
	    {
	       echo "case " . $f_caseID + ": Moving A to a hole and it should have died - FAILED<br/ > ";
	       $f_ok = false;
	    }
	    $f_caseID++;
	
	    if ($f_ok)
	    {
	        echo "Test MoveRobot - OK!<br/ > ";
	    }
	    else
	    {
	        echo "Test MoveRobot - FAILEDY FAILED<br/ > ";
	    }
	}	
	
	public function TestCanMoveRobot($a_engine)
	{
		//To be noted: I kind of messed up the order a bit so the "borderless test" isn't in the described directions
	    //It's Left, Top, Right, Bottom currently... Too lazy to change, tho if test fails and we need it to be in right order 
	    //Then it should be changed!    
	
	    //echo "Start Test CanMoveRobot";

	 	$f_testOK = true;
	
	    $f_game = $a_engine->m_currentGame;
	    $f_positionData;
	    
	    $f_directionString;
	
	    //*************************
	    //Direction to the right
	    ///************************
	    //right test case has extra stuff as it's first time the players are created!
	    $f_directionOK = true;
	
	    $f_directionString = "right";
	
	    $f_playerA = $this->CreatePlayer("A");
	    $f_playerA->m_robot = $this->CreateRobot(1, 1, \game\Direction::Right);
	    $f_game->AddPlayer($f_playerA);
	
	    $f_playerB = $this->CreatePlayer("B");
	    $f_playerB->m_robot = $this->CreateRobot(3, 1, \game\Direction::Right);    
	    $f_game->AddPlayer($f_playerB);
	
	    $f_playerC = $this->CreatePlayer("C");
	    $f_playerC->m_robot = $this->CreateRobot(4,1,\game\Direction::Right);
	
	    //If Yop moves 3 tiles should be blocked by a wall
	    $f_game->m_map->m_tiles[4][1]->m_right = \game\SideObject::Wall;
	    
	    $f_positionData = $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 1, true);    
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== 2 || $f_positionData->m_posY !== 1 || $f_positionData->m_pushedRobot !== null || $f_positionData->m_pushedRobotData !== null)
	    {
	        echo "Test case:  RobotA moves 1 tile to the right FAILED<br/ > ";
	        $f_testOK = false;
	        $f_directionOK = false;
	    }
	    
		//Ok to move robot here cause robot C is not yet added
		$a_engine->MoveRobot($f_playerA->m_robot, 4 ,1 );
		
		$f_positionData = $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 1, true);
		
		if ($f_positionData->m_moveCount !== 0 || $f_positionData->m_posX !== 4 || $f_positionData->m_posY !== 1 || $f_positionData->m_pushedRobot !== null || $f_positionData->m_pushedRobotData !== null)
		{
			echo "Test case:  RobotA moves 0 tiles to the right because wall stopped FAILED<br/ > ";
	        $f_testOK = false;
	        $f_directionOK = false;
		}
		
		//Ok to move robot here cause robot C is not yet added
		$a_engine->MoveRobot($f_playerA->m_robot, 1 ,1 );

	    $f_positionData = $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 2, true);
	
	    if ($f_positionData->m_moveCount !== 2 || $f_positionData->m_posX !== 3 || $f_positionData->m_posY !== 1 || $f_positionData->m_pushedRobot === null || $f_positionData->m_pushedRobotData->m_moveCount !== 1 || $f_positionData->m_pushedRobotData->m_posX !== 4 || $f_positionData->m_pushedRobotData->m_posY !== 1
	    || $f_positionData->m_pushedRobotData->m_pushedRobotData !== null || $f_positionData->m_pushedRobotData->m_pushedRobot !== null)
	    {
	        echo "Test case:  RobotA moves 2 tile to the " . $f_directionString . " and RobotB gets pushed 1 tile to the " . $f_directionString . " FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }  
	
	    $f_positionData = $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 3, true);
	
	    if ($f_positionData->m_moveCount !== 2 || $f_positionData->m_posX !== 3 || $f_positionData->m_posY !== 1 || $f_positionData->m_pushedRobot === null || $f_positionData->m_pushedRobotData->m_moveCount !== 1 || $f_positionData->m_pushedRobotData->m_posX !== 4 || $f_positionData->m_pushedRobotData->m_posY !== 1
	    || $f_positionData->m_pushedRobotData->m_pushedRobotData !== null || $f_positionData->m_pushedRobotData->m_pushedRobot !== null)
	    {
	        echo "Test case:  RobotA moves 2 tile to the " . $f_directionString . " and RobotB gets pushed 1 tile to the " . $f_directionString . " Wall Blocked third movement FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }    
	
	    $f_game->AddPlayer($f_playerC);
	    
	    $f_positionData =  $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 3, true);
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== 2 || $f_positionData->m_posY !== 1 || $f_positionData->m_pushedRobot !== null || $f_positionData->m_pushedRobotData !== null)
	    {
	        echo "Test case:  RobotA moves 2 tile to the " . $f_directionString . " and RobotB gets pushed 1 tile to the " . $f_directionString . " ROBOT C Blocked third movement FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }
	
	    $f_playerA->m_robot->m_direction  = \game\Direction::Left;
	    //This should take robot off the map
	    $f_positionData =  $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 3, true);
	
	    if ($f_positionData->m_moveCount !== 2 || $f_positionData->m_posX !== -1 || $f_positionData->m_posY !== 1 || $f_positionData->m_pushedRobot !== null || $f_positionData->m_pushedRobotData !== null)
	    {
	        echo "Test case:  RobotA moving off the map and should end up 1 tile outside FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }
	
	    if (!$f_directionOK)
	    {
	        echo "Tests moving to the " . $f_directionString . " FAILED<br/ > ";
	    }    
	    
	    ///****************************
	    //Direction Left
	    ///***************************
	    //Reset variables as C entered the scene
	    $f_directionOK = true;
	    
	    $f_directionString = "left";
		
	    $f_game = new Testgame(); 
	    $f_game = $f_game->testgame;   
	    $a_engine->SetCurrentGame($f_game);	    
	
	    $f_playerA->m_robot = $this->CreateRobot(4,1,\game\Direction::Left);
	    $f_game->AddPlayer($f_playerA);
	
	    $f_playerB->m_robot = $this->CreateRobot(2,1,\game\Direction::Bottom);
	    $f_game->AddPlayer($f_playerB);
	
	    $f_playerC->m_robot = $this->CreateRobot(1,1,\game\Direction::Top);    
	
	    $f_game->m_map->m_tiles[1][1]->m_left = \game\SideObject::Wall;    
	
	    $f_positionData =  $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 1, true);    
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== 3 || $f_positionData->m_posY !== 1 || $f_positionData->m_pushedRobot !== null || $f_positionData->m_pushedRobotData !== null)
	    {
	        echo "Test case:  RobotA moves 1 tile to the " . $f_directionString . " FAILED<br/ > ";
	        $f_testOK = false;
	        $f_directionOK = false;
	    }
	
	    $f_positionData =  $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 2, true);
	
	    if ($f_positionData->m_moveCount !== 2 || $f_positionData->m_posX !== 2 || $f_positionData->m_posY !== 1 || $f_positionData->m_pushedRobot === null || $f_positionData->m_pushedRobotData->m_moveCount !== 1 || $f_positionData->m_pushedRobotData->m_posX !== 1 || $f_positionData->m_pushedRobotData->m_posY !== 1
	    || $f_positionData->m_pushedRobotData->m_pushedRobotData !== null || $f_positionData->m_pushedRobotData->m_pushedRobot !== null)
	    {
	        echo "Test case:  RobotA moves 2 tile to the " . $f_directionString . " and RobotB gets pushed 1 tile to the " . $f_directionString . " FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }
	
	    $f_positionData =  $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 3, true);
	
	    if ($f_positionData->m_moveCount !== 2 || $f_positionData->m_posX !== 2 || $f_positionData->m_posY !== 1 || $f_positionData->m_pushedRobot === null || $f_positionData->m_pushedRobotData->m_moveCount !== 1 || $f_positionData->m_pushedRobotData->m_posX !== 1 || $f_positionData->m_pushedRobotData->m_posY !== 1
	    || $f_positionData->m_pushedRobotData->m_pushedRobotData !== null || $f_positionData->m_pushedRobotData->m_pushedRobot !== null)
	    {
	        echo "Test case:  RobotA moves 2 tile to the " . $f_directionString . " and RobotB gets pushed 1 tile to the " . $f_directionString . " Wall Blocked third movement FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }
			
	    //Time to add C to add 
	    $f_game->AddPlayer($f_playerC);
	    
	    $f_positionData =  $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 3, true);
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== 3 || $f_positionData->m_posY !== 1 || $f_positionData->m_pushedRobot !== null || $f_positionData->m_pushedRobotData !== null)
	    {
	        echo "Test case:  RobotA moves 2 tile to the " . $f_directionString . " and RobotB gets pushed 1 tile to the " . $f_directionString . " ROBOT C Blocked third movement FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }
	
	    $f_playerA->m_robot->m_direction  = \game\Direction::Top;
	    //This should take robot off the map
	    $f_positionData =  $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 3, true);
	
	    if ($f_positionData->m_moveCount !== 2 || $f_positionData->m_posX !== 4 || $f_positionData->m_posY !== -1 || $f_positionData->m_pushedRobot !== null || $f_positionData->m_pushedRobotData !== null)
	    {
	        echo "Test case:  RobotA moving off the map and should end up 1 tile outside FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }
	
	    if (!$f_directionOK)
	    {
	        echo "Tests moving to the " . $f_directionString . " FAILED<br/ > ";
	    }		
	        
	    /// ****** ************
	    //Direction Bottom
	    ///*********************
	    //Reset variables as C entered the scene
	    $f_directionOK = true;
	
	    $f_directionString = "bottom";
	
	    $f_game = new Testgame(); 
	    $f_game = $f_game->testgame;   
	    $a_engine->SetCurrentGame($f_game);	    
	
	    $f_playerA->m_robot = $this->CreateRobot(1,1,\game\Direction::Bottom);
	    $f_game->AddPlayer($f_playerA);
	
	    $f_playerB->m_robot = $this->CreateRobot(1,3,\game\Direction::Left);
	    $f_game->AddPlayer($f_playerB);
	
	    $f_playerC->m_robot = $this->CreateRobot(1,4,\game\Direction::Right);
	    
	
	    //If Yop moves 3 tiles should be blocked by a wall
	    $f_game->m_map->m_tiles[1][4]->m_bottom = \game\SideObject::Wall;
	
	    $f_positionData =  $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 1, true);    
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 2 || $f_positionData->m_pushedRobot !== null || $f_positionData->m_pushedRobotData !== null)
	    {
	        echo "Test case:  RobotA moves 1 tile to the " . $f_directionString . " FAILED<br/ > ";
	        $f_testOK = false;
	        $f_directionOK = false;
	    }
	
	    $f_positionData =  $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 2, true);
	
	    if ($f_positionData->m_moveCount !== 2 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 3 || $f_positionData->m_pushedRobot === null || $f_positionData->m_pushedRobotData->m_moveCount !== 1 || $f_positionData->m_pushedRobotData->m_posX !== 1 || $f_positionData->m_pushedRobotData->m_posY !== 4
	    || $f_positionData->m_pushedRobotData->m_pushedRobotData !== null || $f_positionData->m_pushedRobotData->m_pushedRobot !== null)
	    {
	        echo "Test case:  RobotA moves 2 tile to the " . $f_directionString . " and RobotB gets pushed 1 tile to the " . $f_directionString . " FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }
	
	    $f_positionData =  $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 3, true);
	
	    if ($f_positionData->m_moveCount !== 2 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 3 || $f_positionData->m_pushedRobot === null || $f_positionData->m_pushedRobotData->m_moveCount !== 1 || $f_positionData->m_pushedRobotData->m_posX !== 1 || $f_positionData->m_pushedRobotData->m_posY !== 4
	    || $f_positionData->m_pushedRobotData->m_pushedRobotData !== null || $f_positionData->m_pushedRobotData->m_pushedRobot !== null)
	    {
	        echo "Test case:  RobotA moves 2 tile to the " . $f_directionString . " and RobotB gets pushed 1 tile to the " . $f_directionString . " Wall Blocked third movement FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }    
	
	    //Time to add C to add 
	    $f_game->AddPlayer($f_playerC);
	    
	    $f_positionData =  $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 3, true);
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 2 || $f_positionData->m_pushedRobot !== null || $f_positionData->m_pushedRobotData !== null)
	    {
	        echo "Test case:  RobotA moves 2 tile to the " . $f_directionString . " and RobotB gets pushed 1 tile to the " . $f_directionString . " ROBOT C Blocked third movement FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }
	
	    $f_playerA->m_robot->m_direction  = \game\Direction::Right;
	    //Width should be 14, so posX = 12
	    $f_playerA->m_robot->m_posX = $f_game->m_map->m_width - 2;
	
	    //This should take robot off the map
	    $f_positionData =  $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 3, true);   
	
	    if ($f_positionData->m_moveCount !== 2 || $f_positionData->m_posX !== $f_game->m_map->m_width || $f_positionData->m_posY !== 1 || $f_positionData->m_pushedRobot !== null || $f_positionData->m_pushedRobotData !== null)
	    {
	        echo "Test case:  RobotA moving off the map and should end up 1 tile outside FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }
	
	    if (!$f_directionOK)
	    {
	        echo "Tests moving to the " . $f_directionString . " FAILED<br/ > ";
	    }
	
	    ///*******************'
	    //Direction Top
	    ///*******************
	    $f_directionOK = true;
	
	    $f_directionString = "top";
	
	    $f_game = new Testgame(); 
	    $f_game = $f_game->testgame;   
	    $a_engine->SetCurrentGame($f_game);
	    
	
	    $f_playerA->m_robot = $this->CreateRobot(1,4,\game\Direction::Top);
	    $f_game->AddPlayer($f_playerA);
	
	    $f_playerB->m_robot = $this->CreateRobot(1,2,\game\Direction::Bottom);
	    $f_game->AddPlayer($f_playerB);
	
	    $f_playerC->m_robot = $this->CreateRobot(1,1,\game\Direction::Left);   
	
	    $f_game->m_map->m_tiles[1][1]->m_top = \game\SideObject::Wall;
	
	    $f_positionData = $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 1, true);    
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 3 || $f_positionData->m_pushedRobot !== null || $f_positionData->m_pushedRobotData !== null)
	    {
	        echo "Test case:  RobotA moves 1 tile to the " . $f_directionString . " FAILED<br/ > ";
	        $f_testOK = false;
	        $f_directionOK = false;
	    }
	
	    $f_positionData = $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 2, true);
	
	    if ($f_positionData->m_moveCount !== 2 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 2 || $f_positionData->m_pushedRobot === null || $f_positionData->m_pushedRobotData->m_moveCount !== 1 || $f_positionData->m_pushedRobotData->m_posX !== 1 || $f_positionData->m_pushedRobotData->m_posY !== 1
	    || $f_positionData->m_pushedRobotData->m_pushedRobotData !== null || $f_positionData->m_pushedRobotData->m_pushedRobot !== null)
	    {
	        echo "Test case:  RobotA moves 2 tile to the " . $f_directionString . " and RobotB gets pushed 1 tile to the " . $f_directionString . " FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }
	
	    $f_positionData = $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 3, true);
	
	    if ($f_positionData->m_moveCount !== 2 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 2 || $f_positionData->m_pushedRobot === null || $f_positionData->m_pushedRobotData->m_moveCount !== 1 || $f_positionData->m_pushedRobotData->m_posX !== 1 || $f_positionData->m_pushedRobotData->m_posY !== 1
	    || $f_positionData->m_pushedRobotData->m_pushedRobotData !== null || $f_positionData->m_pushedRobotData->m_pushedRobot !== null)
	    {
	        echo "Test case:  RobotA moves 2 tile to the " . $f_directionString . " and RobotB gets pushed 1 tile to the " . $f_directionString . " Wall Blocked third movement FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }
	    
	    //Time to add C to add 
	    $f_game->AddPlayer($f_playerC);
	    
	    $f_positionData = $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 3, true);
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 3 || $f_positionData->m_pushedRobot !== null || $f_positionData->m_pushedRobotData !== null)
	    {
	        echo "Test case:  RobotA moves 2 tile to the " . $f_directionString . " and RobotB gets pushed 1 tile to the " . $f_directionString . " ROBOT C Blocked third movement FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }    
	
	    $f_playerA->m_robot->m_direction = \game\Direction::Bottom;
	    //Width should be 14, so posX = 12
	    $f_playerA->m_robot->m_posY = $f_game->m_map->m_height - 2;
	
	    //This should take robot off the map
	    $f_positionData = $a_engine->CanMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction, 3, true);   
	
	    if ($f_positionData->m_moveCount !== 2 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== $f_game->m_map->m_height || $f_positionData->m_pushedRobot !== null || $f_positionData->m_pushedRobotData !== null)
	    {
	        echo "Test case:  RobotA moving off the map and should end up 1 tile outside FAILED<br/ > ";
	        $f_directionOK = false;
	        $f_testOK = false;
	    }   
	
	    if (!$f_directionOK)
	    {
	        echo "Tests moving to the " . $f_directionString . " FAILED<br/ > ";
	    }
	    
	    ///******************
	    // TEST FINISHED
	    ///******************
	
	    if ($f_testOK)
	    {
	        echo "Test CanMoveRobot - OK!<br/ > ";
	    }
	    else
	    {
	        echo "Test CanMoveRobot - FAILED!<br/ > ";
	    }
	} 

	//******************************
	//  END OF CanMoveRobot
	//******************************

	public function TestCanConveyorMoveRobot($a_engine)
	{
		//Empty shell of CanConveyorMoveRobot!
	    //console.log("Start Test CanConveyorMoveRobot");
	    $f_ok = true;
	
	    $f_directionString;
	
	    $f_game = $a_engine->m_currentGame;
	    $f_positionData;
	
	    $f_testID = 1;
	
	     //*************************
	    //Direction to the right
	    ///************************
	    //right test case has extra stuff as it's first time the players are created!
	    $f_directionOK = true;
	
	    $f_directionString = "right";
	
	    $f_playerA = $this->CreatePlayer("A");
	    $f_playerA->m_robot = $this->CreateRobot(1, 1, \game\Direction::Right);
	    $f_game->AddPlayer($f_playerA);   
	
	    $f_positionData = $a_engine->CanConveyorMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction);    
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== 2 || $f_positionData->m_posY !== 1)
	    {
	        echo "case 1:  RobotA was moved 1 tile to the " . $f_directionString . " FAILED<br />";
	        $f_testOK = false;
	        $f_directionOK = false;       
	    }  
	
	    //If Yop moves 3 tiles should be blocked by a wall
	    $f_game->m_map->m_tiles[1][1]->m_right = \game\SideObject::Wall;
	    $f_positionData = $a_engine->CanConveyorMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction);
	    
	    if ($f_positionData->m_moveCount !== 0 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 1)
	    {
	        echo "case 2:  RobotA was attempted to be moved 1 tile to the " . $f_directionString . " but blocked by a wall FAILED<br />";
	        $f_directionOK = false;
	        $f_testOK = false;        
	    }
	    
	    $f_playerA->m_robot->m_posX = $f_game->m_map->m_width - 1;
	   
	    $f_positionData = $a_engine->CanConveyorMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction);
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== $f_game->m_map->m_width || $f_positionData->m_posY !== 1)
	    {
	        echo "case 3:  RobotA was moved off the map grid to the " . $f_directionString . " FAILED<br />";
	        $f_directionOK = false;
	        $f_testOK = false;   
	    }
	
	    if (!$f_directionOK)
	    {
	        echo "Tests to the " . $f_directionString . " FAILED<br />";
	    }     
	    
	    //*************************
	    //Direction to the left
	    ///************************
	    $f_directionOK = true;
	
	    $f_directionString = "left";
	
      	$f_game = new Testgame(); 
	    $f_game = $f_game->testgame;
	    $a_engine->SetCurrentGame($f_game);
	    
	
	    $f_playerA->m_robot = $this->CreateRobot(2, 1, \game\Direction::Left);
	    $f_game->AddPlayer($f_playerA);
	
	    $f_positionData = $a_engine->CanConveyorMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction);    
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 1)
	    {
	        echo "case 4:  RobotA was moved 1 tile to the " . $f_directionString . " FAILED<br />";
	        $f_testOK = false;
	        $f_directionOK = false;       
	    }  
	
	    //If Yop moves 3 tiles should be blocked by a wall
	    $f_game->m_map->m_tiles[1][1]->m_right = \game\SideObject::Wall;
	    $f_positionData = $a_engine->CanConveyorMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction);
	    
	    if ($f_positionData->m_moveCount !== 0 || $f_positionData->m_posX !== 2 || $f_positionData->m_posY !== 1)
	    {
	        echo "case 5:  RobotA was attempted to be moved 1 tile to the " . $f_directionString . " but blocked by a wall FAILED<br />";
	        $f_directionOK = false;
	        $f_testOK = false;        
	    }
	    
	    $f_playerA->m_robot->m_posX = 0;
	   
	    $f_positionData = $a_engine->CanConveyorMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction);
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== -1 || $f_positionData->m_posY !== 1)
	    {
	        echo "case 6:  RobotA was moved off the map grid to the " . $f_directionString . " FAILED<br />";
	        $f_directionOK = false;
	        $f_testOK = false;   
	    }
	
	
	    if (!$f_directionOK)
	    {
	        echo "Tests to the " . $f_directionString . " FAILED<br />";
	    }  
	
	    //*************************
	    //Direction to the top
	    ///************************
	    $f_directionOK = true;
	
	    $f_directionString = "top";
	
       	$f_game = new Testgame(); 
       	$f_game = $f_game->testgame;
	    $a_engine->SetCurrentGame($f_game);
	    
	
	    $f_playerA->m_robot = $this->CreateRobot(1, 2, \game\Direction::Top);
	    $f_game->AddPlayer($f_playerA);
	
	    $f_positionData = $a_engine->CanConveyorMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction);    
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 1)
	    {
	        echo "case 7:  RobotA was moved 1 tile to the " . $f_directionString . " FAILED<br />";
	        $f_testOK = false;
	        $f_directionOK = false;       
	    }  
	
	    //If Yop moves 3 tiles should be blocked by a wall
	    $f_game->m_map->m_tiles[1][1]->m_bottom = \game\SideObject::Wall;
	    $f_positionData = $a_engine->CanConveyorMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction);
	    
	    if ($f_positionData->m_moveCount !== 0 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 2)
	    {
	        echo "case 8->1:  RobotA was attempted to be moved 1 tile to the " . $f_directionString . " but blocked by a wall FAILED<br />";
	        $f_directionOK = false;
	        $f_testOK = false;        
	    }
	
	    $f_game->m_map->m_tiles[1][2]->m_top = \game\SideObject::Wall;
	    $f_positionData = $a_engine->CanConveyorMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction);
	    
	    if ($f_positionData->m_moveCount !== 0 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 2)
	    {
	        echo "case 8->2:  RobotA was attempted to be moved 1 tile to the " . $f_directionString . " but blocked by a wall FAILED<br />";
	        $f_directionOK = false;
	        $f_testOK = false;        
	    }
	    
	    $f_playerA->m_robot->m_posY = 0;
	   
	    $f_positionData = $a_engine->CanConveyorMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction);
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== -1)
	    {
	        echo "case 9:  RobotA was moved off the map grid to the " . $f_directionString . " FAILED<br />";
	        $f_directionOK = false;
	        $f_testOK = false;   
	    }
	
	
	    if (!$f_directionOK)
	    {
	        echo "Tests to the " . $f_directionString . " FAILED<br />";
	    }
	
	    //*************************
	    //Direction to the Bottom
	    ///************************
	    $f_directionOK = true;
	
	    $f_directionString = "bottom";
	
	    $f_game = new Testgame(); 
	    $f_game = $f_game->testgame;
	    $a_engine->SetCurrentGame($f_game);	    
	
	    $f_playerA->m_robot = $this->CreateRobot(1, 1, \game\Direction::Bottom);
	    $f_game->AddPlayer($f_playerA);
	
	    $f_positionData = $a_engine->CanConveyorMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction);    
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 2)
	    {
	        echo "case 10:  RobotA was moved 1 tile to the " . $f_directionString . " FAILED<br />";
	        $f_testOK = false;
	        $f_directionOK = false;       
	    }  
	
	    //If Yop moves 3 tiles should be blocked by a wall
	    $f_game->m_map->m_tiles[1][2]->m_top = \game\SideObject::Wall;
	    $f_positionData = $a_engine->CanConveyorMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction);
	    
	    if ($f_positionData->m_moveCount !== 0 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 1)
	    {
	        echo "case 11->1:  RobotA was attempted to be moved 1 tile to the " . $f_directionString . " but blocked by a wall FAILED<br />";
	        $f_directionOK = false;
	        $f_testOK = false;        
	    }
	
	    $f_game->m_map->m_tiles[1][1]->m_bottom = \game\SideObject::Wall;
	    $f_positionData = $a_engine->CanConveyorMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction);
	    
	    if ($f_positionData->m_moveCount !== 0 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== 1)
	    {
	        echo "case 11->2:  RobotA was attempted to be moved 1 tile to the " . $f_directionString . " but blocked by a wall FAILED<br />";
	        $f_directionOK = false;
	        $f_testOK = false;        
	    }
	    
	    $f_playerA->m_robot->m_posY = $f_game->m_map->m_height - 1;
	   
	    $f_positionData = $a_engine->CanConveyorMoveRobot($f_playerA->m_robot, $f_playerA->m_robot->m_direction);
	
	    if ($f_positionData->m_moveCount !== 1 || $f_positionData->m_posX !== 1 || $f_positionData->m_posY !== $f_game->m_map->m_height)
	    {
	        echo "case 12:  RobotA was moved off the map grid to the " . $f_directionString . " FAILED<br />";
	        $f_directionOK = false;
	        $f_testOK = false;   
	    }
	
	    if (!$f_directionOK)
	    {
	        echo "Tests to the " . $f_directionString . " FAILED<br />";
	    }
	    
	    if ($f_ok)
	    {
	        echo "CanConveyorMoveRobot Test - OK! <br />";
	    }
	    else
	    {
	        echo "CanConveyorMoveRobot Test - FAILED! <br />";
	    }
	}	
	
	//***************************
	//END OF CanConveyorMoveRobot
	//***************************
	
	
	/*
	 * TestMOveConveyorBelts 
 	*/
	public function TestMoveConveyorBelts($a_engine)
	{
		//Test cases covered:
	    //Normal movement
	    //Normal movement but a wall to stop the cogwheel
	    //A fork movement, nothing moves! A & B tries to same position
	    //A circle movement, A -> B -> C -> D -> A   in old position!
	    //Same but with a wall, making othing move! 
	    //A swap scenario
	
	    //TODO: Fix rotation when they move tho has to implement that in MoveConveyorBelts first tho! 
	
	    //console.log("Start TestMoveConveyorBelts");
	
	    $f_game = $a_engine->m_currentGame;
	
	    $f_ok = true;
	    $f_caseID = 0;
	
	    $f_playerA = $this->CreatePlayer("A");
	    $f_playerA->m_robot = $this->CreateRobot(1, 1, \game\Direction::Left );
	    $f_game->AddPlayer($f_playerA);
	
	    $f_playerB = $this->CreatePlayer("B");
	    $f_playerB->m_robot = $this->CreateRobot(2, 1, \game\Direction::Left);
	    $f_game->AddPlayer($f_playerB);
	
	    $f_playerC = $this->CreatePlayer("C");
	    $f_playerC->m_robot = $this->CreateRobot(3, 1, \game\Direction::Left);
	    $f_game->AddPlayer($f_playerC);
	
	    $f_xstart = 0;
	    $f_xend = 4;
	
	    $f_ystart = 1;
	    $f_yend = 1;
	
	    $y; 
	    $x;
	
	    for ($y = $f_ystart; $y <= $f_yend; $y++) 
	    {
	        for ($x = $f_xstart; $x <= $f_xend; $x++)
	        {
	            $f_game->m_map->m_tiles[$x][$y]->m_direction = \game\Direction::Left;
	            $f_game->m_map->m_tiles[$x][$y]->m_type = \game\TileType::ConveyorBelt;
	        }
	    }
	
	    $a_engine->MoveConveyorBelts(false);
	
	    if ($f_playerA->m_robot->m_posX !== 0 || $f_playerA->m_robot->m_posY !== 1 || $f_playerB->m_robot->m_posX !== 1 || $f_playerB->m_robot->m_posY !== 1 || $f_playerC->m_robot->m_posX !== 2 || $f_playerC->m_robot->m_posY !== 1) {
	        echo "case " . $f_caseID . ": A & B & C moved 1 tile each - FAILED<br />";
	        $f_ok = false;
	    }
	    $f_caseID++;
	
	    $a_engine->MoveRobot($f_playerA->m_robot, 1, 1);
	    $a_engine->MoveRobot($f_playerB->m_robot, 2, 1);
	    $a_engine->MoveRobot($f_playerC->m_robot, 3, 1);
	
	    $f_game->m_map->m_tiles[0][1]->m_right = \game\SideObject::Wall;
	
	    $a_engine->MoveConveyorBelts(false);
	
	    if ($f_playerA->m_robot->m_posX !== 1 || $f_playerA->m_robot->m_posY !== 1 || $f_playerB->m_robot->m_posX !== 2 || $f_playerB->m_robot->m_posY !== 1 || $f_playerC->m_robot->m_posX !== 3 || $f_playerC->m_robot->m_posY !== 1) {
	        echo "case " . $f_caseID . ": A & B & C moved 0 tiles because A was stopped by wall - FAILED<br />";
	        $f_ok = false;
	    }
	    $f_caseID++;
	
	    //reset variables!
	    $f_game->m_map->m_tiles[0][1]->m_right = \game\SideObject::None;
	
	    $a_engine->MoveRobot($f_playerB->m_robot, 2, 2);
	
	    $f_game->m_map->m_tiles[1][1]->m_direction = \game\Direction::Right;
	    $f_game->m_map->m_tiles[2][1]->m_direction = \game\Direction::Top;
	
	    $a_engine->MoveConveyorBelts(false);
	
	    if ($f_playerA->m_robot->m_posX !== 1 || $f_playerA->m_robot->m_posY !== 1 || $f_playerC->m_robot->m_posX !== 3 || $f_playerC->m_robot->m_posY !== 1) {
	        echo "case " . $f_caseID . ": A & C moved 0 tiles because they tried to go to same tile - FAILED<br />";
	        $f_ok = false;
	    }
	    $f_caseID++;
	
	    //RIGHT BOT LEFT TOP!   from 1,1
	    $f_game->m_map->m_tiles[2][1]->m_direction = \game\Direction::Bottom;
	
	    $f_game->m_map->m_tiles[2][2]->m_direction = \game\Direction::Left;
	    $f_game->m_map->m_tiles[2][2]->m_type = \game\TileType::ConveyorBelt;
	
	    $f_game->m_map->m_tiles[1][2]->m_direction = \game\Direction::Top;
	    $f_game->m_map->m_tiles[1][2]->m_type = \game\TileType::ConveyorBelt;
	
	    $a_engine->MoveRobot($f_playerB->m_robot, 2, 1);
	    $a_engine->MoveRobot($f_playerC->m_robot, 2, 2);
	
	    $f_playerD = $this->CreatePlayer("D");
	    $f_playerD->m_robot = $this->CreateRobot(1, 2, \game\Direction::Left);
	    $f_game->AddPlayer($f_playerD);
	
	    $a_engine->MoveConveyorBelts(false);
	
	    if ($f_playerA->m_robot->m_posX !== 2 || $f_playerA->m_robot->m_posY !== 1 || $f_playerB->m_robot->m_posX !== 2 || $f_playerB->m_robot->m_posY !== 2 || $f_playerC->m_robot->m_posX !== 1 || $f_playerC->m_robot->m_posY !== 2 || $f_playerD->m_robot->m_posX !== 1 || $f_playerD->m_robot->m_posY !== 1) {
	        echo "case " . $f_caseID . ": A & B & C & D moved 1 tile in a circle D -> A - B e->t->c-> - FAILED<br />";
	        $f_ok = false;
	    }
	    $f_caseID++;
	
	    $a_engine->MoveRobot($f_playerA->m_robot, 1, 1);
	    $a_engine->MoveRobot($f_playerB->m_robot, 2, 1);
	    $a_engine->MoveRobot($f_playerC->m_robot, 2, 2);
	    $a_engine->MoveRobot($f_playerD->m_robot, 1, 2);
	
	    $f_game->m_map->m_tiles[1][1]->m_right = \game\SideObject::Laserx2;
	
	    $a_engine->MoveConveyorBelts(false);
	
	    if ($f_playerA->m_robot->m_posX !== 1 || $f_playerA->m_robot->m_posY !== 1 || $f_playerB->m_robot->m_posX !== 2 || $f_playerB->m_robot->m_posY !== 1 || $f_playerC->m_robot->m_posX !== 2 || $f_playerC->m_robot->m_posY !== 2 || $f_playerD->m_robot->m_posX !== 1 || $f_playerD->m_robot->m_posY !== 2) {
	        echo "case " . $f_caseID . ": A & B & C & D moved 0 tiles in a circle D -> A - B because wall at A stopped A - FAILED<br />";
	        $f_ok = false;
	    }
	    $f_caseID++;
	
	
	    $f_game->m_map->m_tiles[1][1] = new \game\Tile(\game\TileType::ConveyorBelt, \game\Direction::Right);
	    $f_game->m_map->m_tiles[2][1] = new \game\Tile(\game\TileType::ConveyorBelt, \game\Direction::Left);
	
	    $a_engine->MoveRobot($f_playerA->m_robot, 1, 1);
	    $a_engine->MoveRobot($f_playerB->m_robot, 2, 1);
	    $a_engine->MoveRobot($f_playerC->m_robot, 5, 5); //move em away
	    $a_engine->MoveRobot($f_playerD->m_robot, 5, 5); //move em away
	
	    $a_engine->MoveConveyorBelts(false);
	
	    if ($f_playerA->m_robot->m_posX !== 1 || $f_playerA->m_robot->m_posY !== 1 || $f_playerB->m_robot->m_posX !== 2 || $f_playerB->m_robot->m_posY !== 1) {
	        echo "case " . $f_caseID . ": A & B swapped positions -> <- and not allowed to-> - FAILED<br />";
	        $f_ok = false;
	    }
	    $f_caseID++;
	
	    $a_engine->MoveRobot($f_playerA->m_robot, 1, 1);
	    $a_engine->MoveRobot($f_playerB->m_robot, 1, 2);
	
	     $f_game->m_map->m_tiles[1][1]->m_direction = \game\Direction::Bottom;
	    $f_game->m_map->m_tiles[2][1]->m_direction = \game\Direction::Top;
	
	    $a_engine->MoveConveyorBelts(false);
	
	    if ($f_playerA->m_robot->m_posX !== 1 || $f_playerA->m_robot->m_posY !== 1 || $f_playerB->m_robot->m_posX !== 1 || $f_playerB->m_robot->m_posY !== 2) {
	        echo "case " . $f_caseID . ": A & B swapped positions , A going down B going up and that's not allowed! - FAILED<br />";
	        $f_ok = false;
	    }
	    $f_caseID++;
	
	    	
	    $f_game = new Testgame();
		$f_game = $f_game->testgame;
	    $a_engine->SetCurrentGame($f_game);
	
	    $f_game->AddPlayer($f_playerA);
	
	    $a_engine->MoveRobot($f_playerA->m_robot, 8,8);
	    $f_playerA->m_robot->m_direction = \game\Direction::Top;
	
	
	    $f_game->m_map->m_tiles[8][8]->m_direction = \game\Direction::Top;
	    $f_game->m_map->m_tiles[8][8]->m_type = \game\TileType::ConveyorBelt;
	    $f_game->m_map->m_tiles[8][7]->m_direction = \game\Direction::Right;
	    $f_game->m_map->m_tiles[8][7]->m_type = \game\TileType::ConveyorBelt;  
	   
	    $a_engine->MoveConveyorBelts(false);
	
	    if ($f_playerA->m_robot->m_posX !== 8 || $f_playerA->m_robot->m_posY !== 7 || $f_playerA->m_robot->m_direction !== \game\Direction::Right)
	    {
	        echo "case " . $f_caseID . ": Robot A should have rotated from top to right - FAILED<br />";
	        $f_ok = false;
	    }
	    $f_caseID++;   
	
	    $a_engine->MoveRobot($f_playerA->m_robot, 8,8);
	    $f_playerA->m_robot->m_direction = \game\Direction::Right;
	
	    $a_engine->MoveConveyorBelts(false);
	
	    if ($f_playerA->m_robot->m_posX !== 8 || $f_playerA->m_robot->m_posY !== 7 || $f_playerA->m_robot->m_direction !== \game\Direction::Bottom)
	    {
	        echo "case " . $f_caseID . ": Robot A should have rotated from right to bottom - FAILED<br />";
	        $f_ok = false;
	    }
	    $f_caseID++;  
	    
	    $a_engine->MoveRobot($f_playerA->m_robot, 8,7);
	    $f_playerA->m_robot->m_direction = \game\Direction::Bottom;
	
	    //Should now rotate to the left 
	    $f_game->m_map->m_tiles[8][8]->m_direction = \game\Direction::Right;   
	    $f_game->m_map->m_tiles[8][7]->m_direction = \game\Direction::Bottom;    
	   
	    $a_engine->MoveConveyorBelts(false);
	
	    if ($f_playerA->m_robot->m_posX !== 8 || $f_playerA->m_robot->m_posY !== 8 || $f_playerA->m_robot->m_direction !== \game\Direction::Right)
	    {
	        echo "case " . $f_caseID . ": Robot A should have rotated from Bottom to right - FAILED<br />";
	        $f_ok = false;
	    }
	    $f_caseID++;   
	
	    $a_engine->MoveRobot($f_playerA->m_robot, 8,7);
	    $f_playerA->m_robot->m_direction = \game\Direction::Right;
	
	    $a_engine->MoveConveyorBelts(false);
	
	    if ($f_playerA->m_robot->m_posX !== 8 || $f_playerA->m_robot->m_posY !== 8 || $f_playerA->m_robot->m_direction !== \game\Direction::Top)
	    {
	        echo "case " . $f_caseID . ": Robot A should have rotated from right to top - FAILED<br />";
	        $f_ok = false;
	    }
	    $f_caseID++;  
	
	
	    if ($f_ok) {
	        echo "TestMoveConveyorBelts - OK!<br />";
	    }
	    else {
	        echo "TestMoveConveyorBelts - FAILED!<br />";
	    }
	}
	
	public function TestRotateGears($a_engine)
	{
		//what test is this?
	    echo "Test RotateGears" . "<br/ >";

	    //initialize
	    //a game reference
	    $f_game = $a_engine->m_currentGame;

	    //players
	    $f_player = $this->CreatePlayer("Bob");
	    $f_player->m_robot = $this->CreateRobot(1, 1, \game\Direction::Top);
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Rob");
	    $f_player->m_robot = $this->CreateRobot(2, 1, \game\Direction::Right);
	    $f_game->AddPlayer($f_player);
	    
	    $f_player = $this->CreatePlayer("Todd");
	    $f_player->m_robot = $this->CreateRobot(3, 1, \game\Direction::Left);
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("God");
	    $f_player->m_robot = $this->CreateRobot(4, 1, \game\Direction::Bottom);
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Chuck Norris");
	    $f_player->m_robot = $this->CreateRobot(2, 2, \game\Direction::Right);
	    $f_game->AddPlayer($f_player);

	    //map
	    $f_game->m_map->m_tiles[1][1]->m_type = \game\TileType::GearLeft;
	    $f_game->m_map->m_tiles[2][1]->m_type = \game\TileType::GearRight;
	    $f_game->m_map->m_tiles[3][1]->m_type = \game\TileType::GearLeft;
	    $f_game->m_map->m_tiles[4][1]->m_type = \game\TileType::GearRight;

	    //Chuck Norris's gears
	    $f_game->m_map->m_tiles[1][2]->m_type = \game\TileType::GearLeft;
	    $f_game->m_map->m_tiles[1][3]->m_type = \game\TileType::GearLeft;
	    $f_game->m_map->m_tiles[2][3]->m_type = \game\TileType::GearLeft;
	    $f_game->m_map->m_tiles[3][3]->m_type = \game\TileType::GearLeft;
	    $f_game->m_map->m_tiles[3][2]->m_type = \game\TileType::GearLeft;

	    //give them a spin! guruguru
	    $a_engine->RotateGears();


	    //case 1
	    //  Did Bob rotate correctly?
	    if ($f_game->m_players[0]->m_robot->m_direction === \game\Direction::Left) {
	        echo "case 1: OK" . "<br/ >";
	    }
	    else {
	        echo "case 1: FAILED" . "<br/ >";
	        echo "- " . $f_game->m_players[0]->m_name . " Direction: " . $f_game->m_players[0]->m_robot->m_direction . "<br/ >";
	    }

	    //case 2
	    //  Did Rob rotate correctly?
	    if ($f_game->m_players[1]->m_robot->m_direction === \game\Direction::Bottom) {
	        echo "case 2: OK" . "<br/ >";
	    }
	    else {
	        echo "case 2: FAILED" . "<br/ >";
	        echo "- " . $f_game->m_players[1]->m_name . " Direction: " . $f_game->m_players[1]->m_robot->m_direction . "<br/ >";
	    }

	    //case 3
	    //  Did Todd rotate correctly?
	    if ($f_game->m_players[2]->m_robot->m_direction === \game\Direction::Bottom) {
	        echo "case 3: OK" . "<br/ >";
	    }
	    else {
	        echo "case 3: FAILED" . "<br/ >";
	        echo "- " . $f_game->m_players[2]->m_name . " Direction: " . $f_game->m_players[2]->m_robot->m_direction . "<br/ >";
	    }

	    //case 4
	    //  Did God rotate correctly?
	    if ($f_game->m_players[3]->m_robot->m_direction === \game\Direction::Left) {
	        echo "case 4: OK" . "<br/ >";
	    }
	    else {
	        echo "case 4: FAILED" . "<br/ >";
	        echo "- " . $f_game->m_players[3]->m_name . " Direction: " . $f_game->m_players[3]->m_robot->m_direction . "<br/ >";
	    }

	    //case 5
	    //  Did Chuck Norris rotate? (he shouldn't, because the world rotate around him... Sorry, I couldn't help myself :))
	    if ($f_game->m_players[4]->m_robot->m_direction === \game\Direction::Right) {
	        echo "case 5: OK" . "<br/ >";
	    }
	    else {
	        echo "case 5: FAILED" . "<br/ >";
	        echo "- " . $f_game->m_players[4]->m_name . " Direction: " . $f_game->m_players[4]->m_robot->m_direction . "<br/ >";
	    }
	}
	



	public function TestFireRobotLasers($a_engine)
	{
		//what test is this?
	    echo "Test FireRobotLasers" . "<br/ >";

	    //initialize
	    //a game reference
	    $f_game = $a_engine->m_currentGame;

	    //players
	    $f_player = $this->CreatePlayer("Bob");
	    $f_player->m_robot = $this->CreateRobot(1, 1, \game\Direction::Right);
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Rob");
	    $f_player->m_robot = $this->CreateRobot(2, 1, \game\Direction::Left);
	    $f_player->m_robot->m_health = 1; //weakened
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Todd");
	    $f_player->m_robot = $this->CreateRobot(4, 1, \game\Direction::Left);
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Thud");
	    $f_player->m_robot = $this->CreateRobot(12, 2, \game\Direction::Bottom);
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Lou");
	    $f_player->m_robot = $this->CreateRobot(12, 3, \game\Direction::Top);
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Cody");
	    $f_player->m_robot = $this->CreateRobot(6, 10, \game\Direction::Bottom);
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Shinpachi");
	    $f_player->m_robot = $this->CreateRobot(6, 12, \game\Direction::Top);
	    $f_game->AddPlayer($f_player);
	    $f_player->m_robot->m_powerDownStatus = 1;

	    $f_player = $this->CreatePlayer("Terminator");
	    $f_player->m_robot = $this->CreateRobot(1, 5, \game\Direction::Top);
	    $f_player->m_robot->m_alive = false;
	    $f_game->AddPlayer($f_player);

	    //map
	    $f_game->m_map->m_tiles[12][2]->m_bottom = \game\SideObject::Wall; //a wall between Thud and Lou


	    //shoot the robot lasers!
	    $a_engine->FireRobotLasers();

	    //case 1
	    //  Did Bob take correct amount of damage? (1)
	    //  Bob gets hit by the now dead player Rob and Todds laser doesn't go through Rob
	    if ($f_game->m_players[0]->m_robot->m_health === \game\Robot::MaxHealth - 1) {
	        echo "case 1: OK" . "<br/ >";
	    }
	    else {
	        echo "case 1: FAILED" . "<br/ >";
	        echo "- Health: " . $f_game->m_players[0]->m_robot->m_health . "<br/ >";
	    }

	    //case 2
	    //  Did Rob die? (he's better of that way)
	    //  Rob dies from Bob's laser
	    if ($f_game->m_players[1]->m_robot->m_health <= 0 && $f_game->m_players[1]->m_robot->m_alive !== true) {
	        echo "case 2: OK" . "<br/ >";
	    }
	    else {
	        echo "case 2: FAILED" . "<br/ >";
	        echo "- Health: " . $f_game->m_players[1]->m_robot->m_health . "<br/ >";
	        echo "- Alive: " . $f_game->m_players[1]->m_robot->m_alive . "<br/ >";
	    }

	    //case 3
	    //  Did Thud's laser get blocked? (it should)
	    //  Thud's laser doesn't hit Lou because a "second wall" is blocking the laser
	    if ($f_game->m_players[4]->m_robot->m_health === \game\Robot::MaxHealth) {
	        echo "case 3: OK" . "<br/ >";
	    }
	    else {
	        echo "case 3: FAILED" . "<br/ >";
	        echo "- Health: " . $f_game->m_players[4]->m_robot->m_health . "<br/ >";
	    }

	    //case 4
	    //  Did Lou's laser get blocked? (it should)
	    //  Lou's laser doesn't hit Thud because a "first wall" is blocking the laser
	    if ($f_game->m_players[3]->m_robot->m_health === \game\Robot::MaxHealth) {
	        echo "case 4: OK" . "<br/ >";
	    }
	    else {
	        echo "case 4: FAILED" . "<br/ >";
	        echo "- Health: " . $f_game->m_players[3]->m_robot->m_health . "<br/ >";
	    }

	    //case 5
	    //  Did Cody take correct amount of damage? (1)
	    //  To check if lasers fire properly in the bottom direction
	    if ($f_game->m_players[5]->m_robot->m_health === \game\Robot::MaxHealth - 1) {
	        echo "case 5: OK" . "<br/ >";
	    }
	    else {
	        echo "case 5: FAILED" . "<br/ >";
	        echo "- Health: " . $f_game->m_players[5]->m_robot->m_health . "<br/ >";
	    }

	    //case 6
	    //  Did Shinpachi take correct amount of damage? (1)
	    //  To check if lasers fire properly in the top direction
	    if ($f_game->m_players[6]->m_robot->m_health === \game\Robot::MaxHealth - 1) {
	        echo "case 6: OK" . "<br/ >";
	    }
	    else {
	        echo "case 6: FAILED" . "<br/ >";
	        echo "- Health: " . $f_game->m_players[6]->m_robot->m_health . "<br/ >";
	    }

	    //case 7
	    //  Did Terminator take any damage? (he shouldn't)
	    //  To check if robot's shoots themselves
	    if ($f_game->m_players[7]->m_robot->m_health === \game\Robot::MaxHealth) {
	        echo "case 7: OK" . "<br/ >";
	    }
	    else {
	        echo "case 7: FAILED" . "<br/ >";
	        echo "- Health: " . $f_game->m_players[7]->m_robot->m_health . "<br/ >";
	    }
	}
	




	public function TestFireBoardLasers($a_engine)
	{
		//what test is this?
	    echo "Test FireBoardLasers <br />";

	    //initialize
	    //a game reference
	    $f_game = $a_engine->m_currentGame;

	    //players
	    $f_player = $this->CreatePlayer("Bob");
	    $f_player->m_robot = $this->CreateRobot(4, 4, \game\Direction::Right);
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Rob");
	    $f_player->m_robot = $this->CreateRobot(2, 2, \game\Direction::Right);
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Todd");
	    $f_player->m_robot = $this->CreateRobot(8, 2, \game\Direction::Right);
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Lou");
	    $f_player->m_robot = $this->CreateRobot(8, 5, \game\Direction::Right);
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Mah");
	    $f_player->m_robot = $this->CreateRobot(12, 3, \game\Direction::Right);
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Ken");
	    $f_player->m_robot = $this->CreateRobot(12, 4, \game\Direction::Right);
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Kenny");
	    $f_player->m_robot = $this->CreateRobot(1, 12, \game\Direction::Right);
	    $f_game->AddPlayer($f_player);
	    

	    //map
	    //Bob's lasers.. yes, all of them
	    $f_game->m_map->m_tiles[4][4]->m_top = \game\SideObject::Laserx1;
	    $f_game->m_map->m_tiles[4][4]->m_bottom = \game\SideObject::Laserx2;
	    $f_game->m_map->m_tiles[4][4]->m_left = \game\SideObject::Laserx3;
	    $f_game->m_map->m_tiles[4][4]->m_right = \game\SideObject::Laserx1;

	    //Rob's lasers
	    $f_game->m_map->m_tiles[2][1]->m_top = \game\SideObject::Laserx1;
	    $f_game->m_map->m_tiles[2][3]->m_bottom = \game\SideObject::Laserx1;
	    $f_game->m_map->m_tiles[1][2]->m_left = \game\SideObject::Laserx1;
	    $f_game->m_map->m_tiles[3][2]->m_right = \game\SideObject::Laserx1;
	    
	    //Todd's lasers
	    $f_game->m_map->m_tiles[8][1]->m_top = \game\SideObject::Laserx1;
	    $f_game->m_map->m_tiles[8][3]->m_bottom = \game\SideObject::Laserx1;
	    $f_game->m_map->m_tiles[7][2]->m_left = \game\SideObject::Laserx1;
	    $f_game->m_map->m_tiles[9][2]->m_right = \game\SideObject::Laserx1;
	    //Todd's walls
	    $f_game->m_map->m_tiles[8][2]->m_top = \game\SideObject::Wall;
	    $f_game->m_map->m_tiles[8][2]->m_bottom = \game\SideObject::Wall;
	    $f_game->m_map->m_tiles[8][2]->m_left = \game\SideObject::Wall;
	    $f_game->m_map->m_tiles[8][2]->m_right = \game\SideObject::Wall;

	    //Lou's lasers
	    $f_game->m_map->m_tiles[8][4]->m_top = \game\SideObject::Laserx1;
	    $f_game->m_map->m_tiles[8][6]->m_bottom = \game\SideObject::Laserx1;
	    $f_game->m_map->m_tiles[7][5]->m_left = \game\SideObject::Laserx1;
	    $f_game->m_map->m_tiles[9][5]->m_right = \game\SideObject::Laserx1;
	    //Lou's walls
	    $f_game->m_map->m_tiles[8][4]->m_bottom = \game\SideObject::Wall;
	    $f_game->m_map->m_tiles[8][6]->m_top = \game\SideObject::Wall;
	    $f_game->m_map->m_tiles[7][5]->m_right = \game\SideObject::Wall;
	    $f_game->m_map->m_tiles[9][5]->m_left = \game\SideObject::Wall;

	    //Mah's and Ken's laser
	    $f_game->m_map->m_tiles[12][1]->m_top = \game\SideObject::Laserx1;

	    //Kenny's lasers
	    $f_game->m_map->m_tiles[1][12]->m_top = \game\SideObject::Laserx3;
	    $f_game->m_map->m_tiles[1][12]->m_bottom = \game\SideObject::Laserx3;
	    $f_game->m_map->m_tiles[1][12]->m_left = \game\SideObject::Laserx3;
	    $f_game->m_map->m_tiles[1][12]->m_right = \game\SideObject::Laserx3;

	    //shoot the board lasers!
	    $a_engine->FireBoardLasers();

	    //case 1
	    //  Did Bob take the correct amount of damage? (7)
	    if ($f_game->m_players[0]->m_robot->m_health === \game\Robot::MaxHealth - 7) {
	        echo "case 1: OK" . "<br />";
	    }
	    else {
	        echo "case 1: FAILED" . "<br />";
	        echo "- Health: " . $f_game->m_players[0]->m_robot->m_health . "<br />";
	    }

	    //case 2
	    //  Did Rob take the correct amount of damage? (4)
	    if ($f_game->m_players[1]->m_robot->m_health === \game\Robot::MaxHealth - 4) {
	        echo "case 2: OK" . "<br />";
	    }
	    else {
	        echo "case 2: FAILED" . "<br />";
	        echo "- Health: " . $f_game->m_players[1]->m_robot->m_health . "<br />";
	    }

	    //case 3
	    //  Did Todd take the correct amount of damage? (0)
	    if ($f_game->m_players[2]->m_robot->m_health === \game\Robot::MaxHealth) {
	        echo "case 3: OK" . "<br />";
	    }
	    else {
	        echo "case 3: FAILED" . "<br />";
	        echo "- Health: " . $f_game->m_players[2]->m_robot->m_health . "<br />";
	    }

	    //case 4
	    //  Did Lou take the correct amount of damage? (0)
	    if ($f_game->m_players[3]->m_robot->m_health === \game\Robot::MaxHealth) {
	        echo "case 4: OK" . "<br />";
	    }
	    else {
	        echo "case 4: FAILED" . "<br />";
	        echo "- Health: " . $f_game->m_players[3]->m_robot->m_health . "<br />";
	    }

	    //case 5
	    //  Did Mah and Ken take the correct amount of damage? (Mah: 1, Ken: 0)
	    if ($f_game->m_players[4]->m_robot->m_health === \game\Robot::MaxHealth - 1 && $f_game->m_players[5]->m_robot->m_health === \game\Robot::MaxHealth) {
	        echo "case 5: OK" . "<br />";
	    }
	    else {
	        echo "case 5: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[4]->m_name . " Health: " . $f_game->m_players[4]->m_robot->m_health . "<br />";
	        echo "- " . $f_game->m_players[5]->m_name . " Health: " . $f_game->m_players[5]->m_robot->m_health . "<br />";
	    }

	    //case 6
	    //  Did Kenny die? (he should, you bastard!)
	    if ($f_game->m_players[6]->m_robot->m_health <= 0 && $f_game->m_players[6]->m_robot->m_alive !== true) {
	        echo "case 6: OK" . "<br />";
	    }
	    else {
	        echo "case 6: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[6]->m_name . " Health: " . $f_game->m_players[6]->m_robot->m_health . "<br />";
	        echo "- " . $f_game->m_players[6]->m_name . " Alive: " . $f_game->m_players[6]->m_robot->m_alive . "<br />";
	    }
	}	
	





	public function TestCheckFlags($a_engine)
	{
		//what test is this?
	    echo "Test CheckFlags" . "<br />";

	    //initialize
	    //a game reference
	    $f_game = $a_engine->m_currentGame;

	    //players
	    $f_player = $this->CreatePlayer("Bob");
	    $f_player->m_robot = $this->CreateRobot(1, 1, \game\Direction::Top);
	    $f_player->m_robot->m_alive = false;
	    $f_player->m_robot->m_spawnX = 0;
	    $f_player->m_robot->m_spawnY = 0;
	    $f_player->m_robot->m_health = \game\Robot::MaxHealth - 1;
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Rob");
	    $f_player->m_robot = $this->CreateRobot(1, 3, \game\Direction::Left);
	    $f_player->m_robot->m_spawnX = 0;
	    $f_player->m_robot->m_spawnY = 0;
	    $f_player->m_robot->m_health = \game\Robot::MaxHealth - 5;
	    $f_game->AddPlayer($f_player);

	    $f_player = $this->CreatePlayer("Todd");
	    $f_player->m_robot = $this->CreateRobot(3, 3, \game\Direction::Top);
	    $f_player->m_robot->m_spawnX = 0;
	    $f_player->m_robot->m_spawnY = 0;
	    $f_player->m_robot->m_health = \game\Robot::MaxHealth - 5;
	    $f_game->AddPlayer($f_player);
	    
	    $f_player = $this->CreatePlayer("David");
	    $f_player->m_robot = $this->CreateRobot(5, 4, \game\Direction::Left);
	    $f_player->m_robot->m_spawnX = 0;
	    $f_player->m_robot->m_spawnY = 0;
	    $f_game->AddPlayer($f_player);

	    //map
	    $f_game->m_map->m_tiles[1][1]->m_type = \game\TileType::RepairAndEquip;
	    $f_game->m_map->m_tiles[1][1]->m_checkpoint = 1;
	    $f_game->m_map->m_tiles[1][3]->m_type = \game\TileType::RepairAndEquip;
	    $f_game->m_map->m_tiles[1][3]->m_checkpoint = 1;
	    $f_game->m_map->m_tiles[3][3]->m_type = \game\TileType::Repair;
	    $f_game->m_map->m_tiles[3][3]->m_checkpoint = 2;
	    $f_game->m_map->m_tiles[0][0]->m_type = \game\TileType::Repair;


	    //check for flags!
	    $a_engine->CheckFlags();

	    //case 1
	    //  Did Bob's spawn pos change? (he's dead so he shouldn't get a new spawn pos)
	    if ($f_game->m_players[0]->m_robot->m_spawnX !== $f_game->m_players[0]->m_robot->m_posX && $f_game->m_players[0]->m_robot->m_spawnY !== $f_game->m_players[0]->m_robot->m_posY) {
	        echo "case 1: OK" . "<br />";
	    }
	    else {
	        echo "case 1: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[0]->m_name . " SpawnX: " . $f_game->m_players[0]->m_robot->m_spawnX . "<br />";
	        echo "- " . $f_game->m_players[0]->m_name . " PosX: " . $f_game->m_players[0]->m_robot->m_posX . "<br />";
	        echo "- " . $f_game->m_players[0]->m_name . " SpawnY: " . $f_game->m_players[0]->m_robot->m_spawnY . "<br />";
	        echo "- " . $f_game->m_players[0]->m_name . " PosY: " . $f_game->m_players[0]->m_robot->m_posY . "<br />";
	    }

	    //case 2
	    //  Did Bob gain a card? (he's dead so he shouldn't get bonus cards)
	    if (count($f_game->m_players[0]->m_robot->m_bonusCards) === 0) {
	        echo "case 2: OK" . "<br />";
	    }
	    else {
	        echo "case 2: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[0]->m_name . " BonusCards: " . $f_game->m_players[0]->m_robot->m_bonusCards . "<br />";
	    }

	    //case 3
	    //  Did Bob repair? (he's dead so he shouldn't get repaired)
	    if ($f_game->m_players[0]->m_robot->m_health === \game\Robot::MaxHealth - 1) {
	        echo "case 3: OK" . "<br />";
	    }
	    else {
	        echo "case 3: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[0]->m_name . " Health: " . $f_game->m_players[0]->m_robot->m_health . "<br />";
	    }

	    //case 4
	    //  Did Bob get the checkpoint? (he shouldnt get it because he's dead)
	    if ($f_game->m_players[0]->m_robot->m_nextCheckpoint === 1) {
	        echo "case 4: OK" . "<br />";
	    }
	    else {
	        echo "case 4: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[0]->m_name . " NextCheckpoint: " . $f_game->m_players[0]->m_robot->m_nextCheckpoint . "<br />";
	    }

	    //case 5
	    //  Did Rob's spawn pos change? (he should get a new spawn pos)
	    if ($f_game->m_players[1]->m_robot->m_spawnX === $f_game->m_players[1]->m_robot->m_posX && $f_game->m_players[1]->m_robot->m_spawnY === $f_game->m_players[1]->m_robot->m_posY) {
	        echo "case 5: OK" . "<br />";
	    }
	    else {
	        echo "case 5: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[1]->m_name . " SpawnX: " . $f_game->m_players[1]->m_robot->m_spawnX . "<br />";
	        echo "- " . $f_game->m_players[1]->m_name . " PosX: " . $f_game->m_players[1]->m_robot->m_posX . "<br />";
	        echo "- " . $f_game->m_players[1]->m_name . " SpawnY: " . $f_game->m_players[1]->m_robot->m_spawnY . "<br />";
	        echo "- " . $f_game->m_players[1]->m_name . " PosY: " . $f_game->m_players[1]->m_robot->m_posY . "<br />";
	    }

	    //case 6
	    //  Did Rob gain a card? (he should get a bonus card)
	    if (count($f_game->m_players[1]->m_robot->m_bonusCards) === 1) {
	        echo "case 6: OK" . "<br />";
	    }
	    else {
	        echo "case 6: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[1]->m_name . " BonusCards: " . $f_game->m_players[1]->m_robot->m_bonusCards . "<br />";
	    }

	    //case 7
	    //  Did Bob repair? (he should get repaired)
	    //  He had 5 damage on him and we now check if he has 4 damage on him
	    if ($f_game->m_players[1]->m_robot->m_health === \game\Robot::MaxHealth - 4) {
	        echo "case 7: OK" . "<br />";
	    }
	    else {
	        echo "case 7: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[1]->m_name . " Health: " . $f_game->m_players[1]->m_robot->m_health . "<br />";
	    }

	    //case 8
	    //  Did Rob's get the checkpoint? (he should)
	    if ($f_game->m_players[1]->m_robot->m_nextCheckpoint === 2) {
	        echo "case 8: OK" . "<br />";
	    }
	    else {
	        echo "case 8: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[1]->m_name . " NextCheckpoint: " . $f_game->m_players[1]->m_robot->m_nextCheckpoint . "<br />";
	    }

	    //case 9
	    //  Did Todd's spawn pos change? (he should get a new spawn pos)
	    if ($f_game->m_players[2]->m_robot->m_spawnX === $f_game->m_players[2]->m_robot->m_posX && $f_game->m_players[2]->m_robot->m_spawnY === $f_game->m_players[2]->m_robot->m_posY) {
	        echo "case 9: OK" . "<br />";
	    }
	    else {
	        echo "case 9: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[2]->m_name . " SpawnX: " . $f_game->m_players[2]->m_robot->m_spawnX . "<br />";
	        echo "- " . $f_game->m_players[2]->m_name . " PosX: " . $f_game->m_players[2]->m_robot->m_posX . "<br />";
	        echo "- " . $f_game->m_players[2]->m_name . " SpawnY: " . $f_game->m_players[2]->m_robot->m_spawnY . "<br />";
	        echo "- " . $f_game->m_players[2]->m_name . " PosY: " . $f_game->m_players[2]->m_robot->m_posY . "<br />";
	    }

	    //case 10
	    //  Did Todd's get the checkpoint? (he shouldn't)
	    //  Todd is standing on checkpoint 2, he needs checkpoint 1 before he can get checkpoint 2
	    if ($f_game->m_players[2]->m_robot->m_nextCheckpoint === 1) {
	        echo "case 10: OK" . "<br />";
	    }
	    else {
	        echo "case 10: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[2]->m_name . " NextCheckpoint: " . $f_game->m_players[2]->m_robot->m_nextCheckpoint . "<br />";
	    }

	    //case 11
	    //  Did Todd repair? (he should get repaired)
	    //  Check if the Repair tile type does repair (from 5 damage to 4 damage)
	    if ($f_game->m_players[2]->m_robot->m_health === \game\Robot::MaxHealth - 4) {
	        echo "case 11: OK" . "<br />";
	    }
	    else {
	        echo "case 11: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[2]->m_name . " Health: " . $f_game->m_players[2]->m_robot->m_health . "<br />";
	    }

	    //case 12
	    //  The respawn paranoia case 
	    //  Checks if the respawn is set when it shouldn't
	    if ($f_game->m_players[3]->m_robot->m_spawnX === 0 && $f_game->m_players[3]->m_robot->m_spawnY === 0) {
	        echo "case 12: OK" . "<br />";
	    }
	    else {
	        echo "case 12: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[3]->m_name . " SpawnX: " . $f_game->m_players[3]->m_robot->m_spawnX . " SpawnY: " . $f_game->m_players[3]->m_robot->m_spawnY . "<br />";
	    }
	}
	






	public function TestPushPushers($a_engine)
	{
		//what test is this?
	    echo "Test PushPushers <br />";

	    //initialize
	    //a game reference
	    $f_game = $a_engine->m_currentGame;

	    //players
	    //0
	    $f_playerBob = $this->CreatePlayer("Bob");
	    $f_playerBob->m_robot = $this->CreateRobot(1, 1, \game\Direction::Top);
	    $f_game->AddPlayer($f_playerBob);
	    //1
	    $f_playerRob = $this->CreatePlayer("Rob");
	    $f_playerRob->m_robot = $this->CreateRobot(2, 1, \game\Direction::Top);
	    $f_game->AddPlayer($f_playerRob);
	    //2
	    $f_playerTodd = $this->CreatePlayer("Todd");
	    $f_playerTodd->m_robot = $this->CreateRobot(1, 3, \game\Direction::Top);
	    $f_game->AddPlayer($f_playerTodd);
	    //3
	    $f_playerThud = $this->CreatePlayer("Thud");
	    $f_playerThud->m_robot = $this->CreateRobot(2, 3, \game\Direction::Top);
	    $f_game->AddPlayer($f_playerThud);
	    //4
	    $f_playerFred = $this->CreatePlayer("Fred");
	    $f_playerFred->m_robot = $this->CreateRobot(4, 1, \game\Direction::Top);
	    $f_game->AddPlayer($f_playerFred);
	    //5
	    $f_playerTed = $this->CreatePlayer("Ted");
	    $f_playerTed->m_robot = $this->CreateRobot(5, 1, \game\Direction::Top);
	    $f_game->AddPlayer($f_playerTed);
	    //6
	    $f_playerJoe = $this->CreatePlayer("Joe");
	    $f_playerJoe->m_robot = $this->CreateRobot(4, 2, \game\Direction::Top);
	    $f_game->AddPlayer($f_playerJoe);
	    //7 blocking path for joe
	    $f_playerLou = $this->CreatePlayer("Lou");
	    $f_playerLou->m_robot = $this->CreateRobot(5, 2, \game\Direction::Top);
	    $f_playerLou->m_robot->m_alive = false;
	    $f_game->AddPlayer($f_playerLou);
	    $f_game->m_map->m_tiles[$f_playerLou->m_robot->m_posX][$f_playerLou->m_robot->m_posY]->r_robot = null;
	    //8
	    $f_playerManfred = $this->CreatePlayer("Manfred");
	    $f_playerManfred->m_robot = $this->CreateRobot(7, 1, \game\Direction::Top);
	    $f_game->AddPlayer($f_playerManfred);
	    //9
	    $f_playerAmandfred = $this->CreatePlayer("Amandfred");
	    $f_playerAmandfred->m_robot = $this->CreateRobot(8, 1, \game\Direction::Top);
	    $f_game->AddPlayer($f_playerAmandfred);
	    //10
	    $f_playerCasey = $this->CreatePlayer("Casey");
	    $f_playerCasey->m_robot = $this->CreateRobot(7, 3, \game\Direction::Right);
	    $f_game->AddPlayer($f_playerCasey);
	    //11
	    $f_playerCarl = $this->CreatePlayer("Carl");
	    $f_playerCarl->m_robot = $this->CreateRobot(8, 3, \game\Direction::Left);
	    $f_game->AddPlayer($f_playerCarl);
	    //12
	    $f_playerA = $this->CreatePlayer("A");
	    $f_playerA->m_robot = $this->CreateRobot(7, 5, \game\Direction::Bottom);
	    $f_game->AddPlayer($f_playerA);
	    //13
	    $f_playerB = $this->CreatePlayer("B");
	    $f_playerB->m_robot = $this->CreateRobot(7, 6, \game\Direction::Right);
	    $f_game->AddPlayer($f_playerB);
	    //14
	    $f_playerC = $this->CreatePlayer("C");
	    $f_playerC->m_robot = $this->CreateRobot(8, 6, \game\Direction::Top);
	    $f_game->AddPlayer($f_playerC);
	    //15
	    $f_playerD = $this->CreatePlayer("D");
	    $f_playerD->m_robot = $this->CreateRobot(8, 5, \game\Direction::Left);
	    $f_game->AddPlayer($f_playerD);
	    //16
	    $f_playerMah = $this->CreatePlayer("Mah");
	    $f_playerMah->m_robot = $this->CreateRobot(7, 8, \game\Direction::Right);
	    $f_game->AddPlayer($f_playerMah);
	    //17
	    $f_playerKen = $this->CreatePlayer("Ken");
	    $f_playerKen->m_robot = $this->CreateRobot(9, 8, \game\Direction::Left);
	    $f_game->AddPlayer($f_playerKen);
	    //18
	    $f_playerHonda = $this->CreatePlayer("Honda");
	    $f_playerHonda->m_robot = $this->CreateRobot(6, 8, \game\Direction::Left);
	    $f_game->AddPlayer($f_playerHonda);
	    //19
	    $f_playerSimba = $this->CreatePlayer("Simba");
	    $f_playerSimba->m_robot = $this->CreateRobot(0, 5, \game\Direction::Right);
	    $f_playerSimba->m_robot->m_lives = 1;
	    $f_game->AddPlayer($f_playerSimba);
	    //20
	    $f_playerNala = $this->CreatePlayer("Nala");
	    $f_playerNala->m_robot = $this->CreateRobot(2, 5, \game\Direction::Left);
	    $f_playerNala->m_robot->m_lives = 1;
	    $f_game->AddPlayer($f_playerNala);
	    //21
	    $f_playerRamon = $this->CreatePlayer("Ramon");
	    $f_playerRamon->m_robot = $this->CreateRobot(0, 6, \game\Direction::Right);
	    $f_playerRamon->m_robot->m_lives = 1;
	    $f_game->AddPlayer($f_playerRamon);

	    //map
	    $f_game->m_map->m_tiles[1][1]->m_top = \game\SideObject::PusherEven; //Bob's pusher
	    $f_game->m_map->m_tiles[2][1]->m_bottom = \game\SideObject::PusherEven; //Rob's pusher
	    $f_game->m_map->m_tiles[1][3]->m_right = \game\SideObject::PusherEven; //Todd's pusher
	    $f_game->m_map->m_tiles[2][3]->m_left = \game\SideObject::PusherEven; //Thud's pusher
	    $f_game->m_map->m_tiles[4][1]->m_left = \game\SideObject::PusherEven; //Fred & Ted's pusher
	    $f_game->m_map->m_tiles[4][2]->m_left = \game\SideObject::PusherEven; //Joe & Lou's pusher
	    $f_game->m_map->m_tiles[7][1]->m_bottom = \game\SideObject::PusherEven; //Manfred's pusher
	    $f_game->m_map->m_tiles[7][1]->m_top = \game\SideObject::Wall; //Manfred's wall
	    $f_game->m_map->m_tiles[8][1]->m_bottom = \game\SideObject::PusherEven; //Amandfred's pusher
	    $f_game->m_map->m_tiles[8][0]->m_bottom = \game\SideObject::Wall; //Amandfred's wall
	    $f_game->m_map->m_tiles[7][3]->m_left = \game\SideObject::PusherEven; //Casey's pusher
	    $f_game->m_map->m_tiles[8][3]->m_right = \game\SideObject::PusherEven; //Carl's pusher
	    $f_game->m_map->m_tiles[7][5]->m_top = \game\SideObject::PusherEven; //A's pusher
	    $f_game->m_map->m_tiles[7][6]->m_left = \game\SideObject::PusherEven; //B's pusher
	    $f_game->m_map->m_tiles[8][6]->m_bottom = \game\SideObject::PusherEven; //C's pusher
	    $f_game->m_map->m_tiles[8][5]->m_right = \game\SideObject::PusherEven; //D's pusher
	    $f_game->m_map->m_tiles[7][8]->m_left = \game\SideObject::PusherEven; //Mah's pusher
	    $f_game->m_map->m_tiles[9][8]->m_right = \game\SideObject::PusherEven; //Ken's pusher
	    $f_game->m_map->m_tiles[6][8]->m_right = \game\SideObject::PusherOdd; //Honda's pusher
	    $f_game->m_map->m_tiles[0][5]->m_left = \game\SideObject::PusherOdd; //Simba's pusher
	    $f_game->m_map->m_tiles[1][5]->m_type = \game\TileType::Hole; //Simba's and Nala's hole
	    $f_game->m_map->m_tiles[2][5]->m_right = \game\SideObject::PusherOdd; //Nala's pusher
	    $f_game->m_map->m_tiles[0][6]->m_right = \game\SideObject::PusherOdd; //Ramon's pusher

	    /*----------------------------------------------------------------------------------
	    test the even pushers
	    ------------------------------------------------------------------------------------*/
	    //push the even pushers
	    $a_engine->PushPushers(1);

	    //case 1
	    //  Did Bob get pushed? (he should)
	    //  To test top pushers
	    if ($f_game->m_players[0]->m_robot->m_posX === 1 && $f_game->m_players[0]->m_robot->m_posY === 2) {
	        echo "case 1: OK" . "<br />";
	    }
	    else {
	        echo "case 1: FAILED"  . "<br />";
	        echo "- " . $f_game->m_players[0]->m_name . " PosX: " . $f_game->m_players[0]->m_robot->m_posX . "<br />";
	        echo "- " . $f_game->m_players[0]->m_name . " PosY: " . $f_game->m_players[0]->m_robot->m_posY . "<br />";
	    }

	    //case 2
	    //  Did Rob get pushed? (he should)
	    //  To test bottom pushers
	    if ($f_game->m_players[1]->m_robot->m_posX === 2 && $f_game->m_players[1]->m_robot->m_posY === 0) {
	        echo "case 2: OK" . "<br />";
	    }
	    else {
	        echo "case 2: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[1]->m_name . " PosX: " . $f_game->m_players[1]->m_robot->m_posX . "<br />";
	        echo "- " . $f_game->m_players[1]->m_name . " PosY: " . $f_game->m_players[1]->m_robot->m_posY . "<br />";
	    }

	    //case 3
	    //  Did Todd get pushed? (he should)
	    //  To test right pushers
	    if ($f_game->m_players[2]->m_robot->m_posX === 0 && $f_game->m_players[2]->m_robot->m_posY === 3) {
	        echo "case 3: OK" . "<br />";
	    }
	    else {
	        echo "case 3: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[2]->m_name . " PosX: " . $f_game->m_players[2]->m_robot->m_posX . "<br />";
	        echo "- " . $f_game->m_players[2]->m_name . " PosY: " . $f_game->m_players[2]->m_robot->m_posY . "<br />";
	    }

	    //case 4
	    //  Did Thud get pushed? (he should)
	    //  To test left pushers
	    if ($f_game->m_players[3]->m_robot->m_posX === 3 && $f_game->m_players[3]->m_robot->m_posY === 3) {
	        echo "case 4: OK" . "<br />";
	    }
	    else {
	        echo "case 4: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[3]->m_name . " PosX: " . $f_game->m_players[3]->m_robot->m_posX . "<br />";
	        echo "- " . $f_game->m_players[3]->m_name . " PosY: " . $f_game->m_players[3]->m_robot->m_posY . "<br />";
	    }

	    //case 5
	    //  Did Ted get pushed by Fred (that got pushed by a pusher)? (he shouldn't)
	    //  To test that pushers doesn't push robots if a robot is in the way
	    if ($f_game->m_players[4]->m_robot->m_posX === 4 && $f_game->m_players[4]->m_robot->m_posY === 1 && $f_game->m_players[5]->m_robot->m_posX === 5 && $f_game->m_players[5]->m_robot->m_posY === 1) {
	        echo "case 5: OK" . "<br />";
	    }
	    else {
	        echo "case 5: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[4]->m_name . " PosX: " . $f_game->m_players[4]->m_robot->m_posX . ", PosY: " . $f_game->m_players[4]->m_robot->m_posY . "<br />";
	        echo "- " . $f_game->m_players[5]->m_name . " PosX: " . $f_game->m_players[5]->m_robot->m_posX . ", PosY: " . $f_game->m_players[5]->m_robot->m_posY . "<br />";
	    }

	    //case 6
	    //  Did Joe get pushed by the pusher? (he should)
	    //  To test that pushers ignores dead robots (Lou is a dead robot at the position where Joe should end up)
	    if ($f_game->m_players[6]->m_robot->m_posX === 5 && $f_game->m_players[6]->m_robot->m_posY === 2) {
	        echo "case 6: OK" . "<br />";
	    }
	    else {
	        echo "case 6: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[6]->m_name . " PosX: " . $f_game->m_players[6]->m_robot->m_posX . ", PosY: " . $f_game->m_players[6]->m_robot->m_posY . "<br />";
	        echo "- " . $f_game->m_players[7]->m_name . " PosX: " . $f_game->m_players[7]->m_robot->m_posX . ", PosY: " . $f_game->m_players[7]->m_robot->m_posY . "<br />";
	    }

	    //case 7
	    //  Did Manfred get pushed? (he shouldn't)
	    //  To test that pushers won't push if there is a wall (facing towards you) in the way
	    if ($f_game->m_players[8]->m_robot->m_posX === 7 && $f_game->m_players[8]->m_robot->m_posY === 1) {
	        echo "case 7: OK" . "<br />";
	    }
	    else {
	        echo "case 7: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[8]->m_name . " PosX: " . $f_game->m_players[8]->m_robot->m_posX . ", PosY: " . $f_game->m_players[8]->m_robot->m_posY . "<br />";
	    }

	    //case 8
	    //  Did Amandfred get pushed? (she shouldn't)
	    //  To test that pushers won't push if there is a wall (facing away from you) in the way
	    if ($f_game->m_players[9]->m_robot->m_posX === 8 && $f_game->m_players[9]->m_robot->m_posY === 1) {
	        echo "case 8: OK" . "<br />";
	    }
	    else {
	        echo "case 8: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[9]->m_name . " PosX: " . $f_game->m_players[9]->m_robot->m_posX . ", PosY: " . $f_game->m_players[9]->m_robot->m_posY . "<br />";
	    }

	    //case 9
	    //  Did Casey and Carl get pushed? (they shouldn't)
	    //  To test that pushers won't push if A & B is next to each other and both have a pusher that would push them to the other robot's position
	    if ($f_game->m_players[10]->m_robot->m_posX === 7 && $f_game->m_players[10]->m_robot->m_posY === 3 && $f_game->m_players[11]->m_robot->m_posX === 8 && $f_game->m_players[11]->m_robot->m_posY === 3) {
	        echo "case 9: OK" . "<br />";
	    }
	    else {
	        echo "case 9: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[10]->m_name . " PosX: " . $f_game->m_players[10]->m_robot->m_posX . ", PosY: " . $f_game->m_players[10]->m_robot->m_posY . "<br />";
	        echo "- " . $f_game->m_players[11]->m_name . " PosX: " . $f_game->m_players[11]->m_robot->m_posX . ", PosY: " . $f_game->m_players[11]->m_robot->m_posY . "<br />";
	    }

	    //case 10
	    //  A will be pushed to B's pos and B to C's and D to A's
	    //  To test that pushers do push when in a circle formation?
	    if ($f_game->m_players[12]->m_robot->m_posX === 7 && $f_game->m_players[12]->m_robot->m_posY === 6 && $f_game->m_players[13]->m_robot->m_posX === 8 && $f_game->m_players[13]->m_robot->m_posY === 6 && $f_game->m_players[14]->m_robot->m_posX === 8 && $f_game->m_players[14]->m_robot->m_posY === 5 && $f_game->m_players[15]->m_robot->m_posX === 7 && $f_game->m_players[15]->m_robot->m_posY === 5) {
	        echo "case 10: OK" . "<br />";
	    }
	    else {
	        echo "case 10: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[12]->m_name . " PosX: " . $f_game->m_players[12]->m_robot->m_posX . ", PosY: " . $f_game->m_players[12]->m_robot->m_posY . "<br />";
	        echo "- " . $f_game->m_players[13]->m_name . " PosX: " . $f_game->m_players[13]->m_robot->m_posX . ", PosY: " . $f_game->m_players[13]->m_robot->m_posY . "<br />";
	        echo "- " . $f_game->m_players[14]->m_name . " PosX: " . $f_game->m_players[14]->m_robot->m_posX . ", PosY: " . $f_game->m_players[14]->m_robot->m_posY . "<br />";
	        echo "- " . $f_game->m_players[15]->m_name . " PosX: " . $f_game->m_players[15]->m_robot->m_posX . ", PosY: " . $f_game->m_players[15]->m_robot->m_posY . "<br />";
	    }

	    //case 11
	    //  Did Mah or Ken get pushed? (they shouldn't)
	    //  To test that pushers won't push when 2 or more robots would be pushed to the same tile
	    if ($f_game->m_players[16]->m_robot->m_posX === 7 && $f_game->m_players[16]->m_robot->m_posY === 8 && $f_game->m_players[17]->m_robot->m_posX === 9 && $f_game->m_players[17]->m_robot->m_posY === 8) {
	        echo "case 11: OK" . "<br />";
	    }
	    else {
	        echo "case 11: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[16]->m_name . " PosX: " . $f_game->m_players[16]->m_robot->m_posX . ", PosY: " . $f_game->m_players[16]->m_robot->m_posY . "<br />";
	        echo "- " . $f_game->m_players[17]->m_name . " PosX: " . $f_game->m_players[17]->m_robot->m_posX . ", PosY: " . $f_game->m_players[17]->m_robot->m_posY . "<br />";
	    }



	    /*----------------------------------------------------------------------------------
	    test the odd pushers
	    ------------------------------------------------------------------------------------*/
	    //push the odd pushers
	    $a_engine->PushPushers(2);

	    //case 12
	    //testing odd pushers
	    if ($f_game->m_players[18]->m_robot->m_posX === 5 && $f_game->m_players[18]->m_robot->m_posY === 8) {
	        echo "case 12: OK" . "<br />";
	    }
	    else {
	        echo "case 12: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[18]->m_name . " PosX: " . $f_game->m_players[18]->m_robot->m_posX . ", PosY: " . $f_game->m_players[18]->m_robot->m_posY . "<br />";
	    }

	    //case 13
	    //  Did Simba and Nala get pushed into the hole? (they should)
	    //  To test that pushers can push multiple robots into the same hole
	    if ($f_game->m_players[19]->m_robot->m_alive === false && $f_game->m_players[20]->m_robot->m_alive === false) {
	        echo "case 13: OK" . "<br />";
	    }
	    else {
	        echo "case 13: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[19]->m_name . " PosX: " . $f_game->m_players[19]->m_robot->m_posX . ", PosY: " . $f_game->m_players[19]->m_robot->m_posY . ", Alive: " . $f_game->m_players[19]->m_robot->m_alive . "<br />";
	        echo "- " . $f_game->m_players[20]->m_name . " PosX: " . $f_game->m_players[20]->m_robot->m_posX . ", PosY: " . $f_game->m_players[20]->m_robot->m_posY . ", Alive: " . $f_game->m_players[20]->m_robot->m_alive . "<br />";
	    }

	    //case 14
	    //  Did Ramon get pushed outside the map? (he should)
	    //  To test that pushers can push robots outside the map
	    if ($f_game->m_players[21]->m_robot->m_alive === false) {
	        echo "case 14: OK" . "<br />";
	    }
	    else {
	        echo "case 14: FAILED" . "<br />";
	        echo "- " . $f_game->m_players[21]->m_name . " PosX: " . $f_game->m_players[21]->m_robot->m_posX . ", PosY: " . $f_game->m_players[21]->m_robot->m_posY . ", Alive: " . $f_game->m_players[21]->m_robot->m_alive . "<br />";
	    }
	}
	
	/*
	 * a shell
	public function Testtest($a_engine)
	{
		$f_game = $a_engine->m_currentGame;		
		
	}
	*/

	public function CreatePlayer($a_name = null)
	{
		//create the player
		$f_player = new \game\Player();

		//set variables
		$f_player->m_name = $a_name;

		//return it!
		return $f_player;
	}

	public function CreateRobot($a_posX = null, $a_posY = null, $a_direction = null)
	{
		//create the robot
		$f_robot = new \game\Robot();

		//set variables
		$f_robot->m_registers = array(); //Array holding registers
	    $f_robot->m_bonusCards = array(); // Array holding bonus cards

	    $f_robot->m_health = $f_robot::MaxHealth; // Default amount of start HP.
	    $f_robot->m_lives = 3; // Default amount of Lives.
	    $f_robot->m_alive = true;

	    if($a_posX !== null && $a_posY !== null)
	    {
		    $f_robot->m_posX = $a_posX;
		    $f_robot->m_posY = $a_posY;
		}
		else
		{
			throw new \Exception("CreateRobot requires $a_posX, $a_posY");
		}
	    $f_robot->m_spawnX = 0;
	    $f_robot->m_spawnY = 0;

	    if($a_direction !== null)
	    {
	    	$f_robot->m_direction = $a_direction;
	    }
	    else 
	    {
	    	$f_robot->m_direction = 0;
	    }
	    $f_robot->m_powerDownStatus = \game\PowerDownStatus::False; // powerdown status is by default false

	    $f_robot->m_nextCheckpoint = 1;

	    $f_robot->m_laserPower = 1;

	    for ($i = 0; $i < 5; $i++) 
	    {
	        $f_robot->m_registers[$i] = new \game\Register();       
	    }


		//return it!
		return $f_robot;
	}
}

$m_engineTest = new EngineTest();

$m_engineTest->RunEngineTest();

?>